//package cn.wuyu.baselibrary.mvvm;
//
//import android.arch.lifecycle.LifecycleOwner;
//import android.arch.lifecycle.MutableLiveData;
//import android.arch.lifecycle.ViewModel;
//
////import com.test.MyLiveDataToViewModel.base.BaseActionEvent;
////import com.test.MyLiveDataToViewModel.base.BaseContract;
//
//public class BaseViewModel extends ViewModel implements BaseContract {
//
//    private MutableLiveData<BaseActionEvent> actionLiveData;
//    private LifecycleOwner lifecycleOwner;
//
//    public BaseViewModel() {
//        this.actionLiveData = new MutableLiveData<>();
//    }
//
//    @Override
//    public void startLoading(String message) {
//        BaseActionEvent event = new BaseActionEvent(BaseActionEvent.ActionEvent.SHOW_LOADING_DIALOG);
//        event.setMessage(message);
//        actionLiveData.setValue(event);
//    }
//
//    @Override
//    public void dismissLoading() {
//        actionLiveData.setValue(new BaseActionEvent(BaseActionEvent.ActionEvent.DISMISS_LOADING_DIALOG));
//    }
//
//    @Override
//    public void showToast(String message) {
//        BaseActionEvent baseActionEvent = new BaseActionEvent(BaseActionEvent.ActionEvent.TOAST);
//        baseActionEvent.setMessage(message);
//        actionLiveData.setValue(baseActionEvent);
//    }
//
//    @Override
//    public void close() {
//        actionLiveData.setValue(new BaseActionEvent(BaseActionEvent.ActionEvent.FINISH));
//    }
//
//    public MutableLiveData<BaseActionEvent> getActionLiveData() {
//        return actionLiveData;
//    }
//
//    public void setLifecycleOwner(LifecycleOwner lifecycleOwner) {
//        this.lifecycleOwner = lifecycleOwner;
//    }
//
//    public LifecycleOwner getLifecycleOwner(){
//        return lifecycleOwner;
//    }
//}
